from django.views.generic import View
from django.http import HttpResponse
from django.core.cache import cache
from django.core.cache.backends.memcached import MemcachedCache


class IndexView(View):
    def get(self, request, *args, **kwargs):
        cache.set('username', 'hello world', 120)
        print(cache.get('username'))
        return HttpResponse('首页')



